package com.kgc.fk.controller;

import com.kgc.basic.util.ResponseMsg;
import com.kgc.collection.remote.PrePayApi;
import com.kgc.fk.feign.CwCGDDProviderFeign;
import com.kgc.fk.service.PrePayService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@RestController
public class PrePayController implements PrePayApi {

    private Logger logger = LoggerFactory.getLogger(PrePayController.class);

    @Resource
    private PrePayService prePayService;
//    @Resource
//    private CwCGDDProviderFeign cwCGDDProviderFeign;

    @Override
    public ResponseMsg getPrePayPage(Map<String, Object> params) {
        logger.info("getPrePayPage map {}", params);
        ResponseMsg responseMsg = prePayService.getPrePayPage(params);
        return responseMsg;
    }

    @Override
    public ResponseMsg addPrePay(Map<String, Object> params) {
        logger.info("addPrePay map {}", params);
        ResponseMsg responseMsg = prePayService.addPrePay(params);
        return responseMsg;
    }

    @Override
    public ResponseMsg updatePrePay(Map<String, Object> params) {
        logger.info("updatePrePay map {}", params);
        ResponseMsg responseMsg = prePayService.updatePrePay(params);
        logger.info("updatePrePay params{} result {}",params, responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg getPrePay(Map<String, Object> params) {
        logger.info("getPrePay map {}", params);
        ResponseMsg responseMsg = prePayService.getPrePay(params);
        logger.info("getPrePay params{} result {}",params, responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg modiPrePay(Map<String, Object> params) {
        logger.info("modiPrePay map {}", params);
        ResponseMsg responseMsg = prePayService.modiPrePay(params);
        logger.info("modiPrePay params{} result {}",params, responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg getPrePayList(Map<String, Object> params) {
        logger.info("getPrePayList map {}", params);
        ResponseMsg responseMsg = prePayService.getPrePayList(params);
        logger.info("getPrePayList params{} result {}",params, responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg calPrePayRefund(String code) {
        logger.info("calPrePayRefund code {}", code);
        Map<String, Object> params = null;
        ResponseMsg responseMsg = prePayService.calPrePayRefund(code, params);
        logger.info("calPrePayRefund params{} result {}",code, responseMsg);
        return responseMsg;
    }


}
